package org.zbclan.bf2.rcon.event;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.vaadin.ui.Component;

public class DisplayEvent extends GwtEvent<DisplayEvent.Handler> {

	public interface Handler extends EventHandler {

		Type<Handler> TYPE = new Type<Handler>();

		void onEvent(DisplayEvent event);
	}

	private final Component component;

	public DisplayEvent(Component component) {
		this.component = component;
	}

	@Override
	public Type<Handler> getAssociatedType() {
		return Handler.TYPE;
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.onEvent(this);
	}

	public Component getComponent() {
		return component;
	}
}
